<div style="margin-top: 13px;"></div>

<!--POSLEDNJI CLANAK-->

<article>
    <section>

        <div id="naslovnan">

            <div id="naslovnaimg" class="separator">

                <style>
                    #slider-1 {
                        position:relative;
                        width:500px;
                        height:291px;
                        background:url(<?=$url?>assets/images/nivoslider/loading.gif) no-repeat 50% 50%;
                    }
                    #slider-1 img {
                        position:absolute;
                        top:0px;
                        left:0px;
                        display:none;
                    }
                    #slider-1 a {
                        border:0;
                        display:block;
                    }
                </style>

                <? $link = base_url().sredinaslov($last[0]['title'],$last[0]['id'],$last[0]['sName']); ?>

                <a href="<?=$link?>" class="mPhoto">
                    <div id="slider-1" class="nivoSlider">


                        <?

                            if(count($articleImagesMain)>1){

                                foreach($articleImagesMain as $artImages){
                                ?>
                                <img src="<?=$url.'cache/'.$this->img_map->showImage($artImages['mFile'],500,291,"exacttop");?>" alt="<?=$artImages['caption']?>" title="<?=$artImages['caption']?>" width="500" height="291" />
                                <?
                                }

                            }else{
                                switch($last[0]['mType']){
                                    case 'img':
                                        $img = "getimage.php?img=".$last[0]['mFile']."&w=500&h=291&exacttop"; ?>
                                    <img src="<?=$img?>" alt="<?=$last[0]['caption']?>" title="<?=$last[0]['caption']?>" width="500" height="291" /><?
                                        break;

                                    case 'yt':
                                        $img = "getimage.php?img=".$last[0]['mFile'].".jpg&w=500&h=291&exacttop"; ?>
                                    <img src="<?=$img?>" alt="<?=$last[0]['caption']?>" title="<?=$last[0]['caption']?>" width="500" height="291" />
                                    <div class="videoBig">&nbsp;</div><?
                                        break;
                                } 
                            }

                        ?>                    

                    </div>

                    <div class="nadnaslov overwrite"><?=$last[0]['uptitle']?></div> 

                </a> 

            </div>

            <div style="clear: both; font-size: 0; line-height: 0;"></div> 

            <h2><a class="mLink" href="<?=$link?>"><?=$last[0]['title']?></a></h2>

            <div class="intro">
                <? if($last[0]['status']==1){?> 
                    <span class="flag updated">Ажуриранo</span>
                    <?}else{?>
                    <span class="flag new">Ново</span>
                    <?}?>
            <?=$last[0]['intro']?> </div>

        </div>

    </section>  
</article>

<!--4 SIDE-->

<?
    $cnt = count($four_side);
    for($k=1;$k<$cnt;$k++){

        if($k%2==0){?>

        <div class="kocka">

        <?}else{?>

        <div class="kocka marginleft">

            <?}

            $cssBgImageOverwrite = "";
            $cssBorderOverwrite = "";

            switch($four_side[$k]['mType']){

                case 'yt':
                    $cssBgImageOverwrite = 'nadnaslovVid';
                    $cssBorderOverwrite = 'kockaimgVid';
                    break;
            }

            $link = base_url().sredinaslov($four_side[$k]['title'],$four_side[$k]['id'],$four_side[$k]['sName']);

        ?>

        <div class="kockaimg <?=$cssBorderOverwrite?>">
            <a href="<?=$link?>" class="mPhoto">
                <?

                    switch($four_side[$k]['mType']){
                        case 'img':?>
                        <img src="<?=$url.'cache/'.$this->img_map->showImage($four_side[$k]['mFile'],238,155,"exacttop");?>" alt="<?=$four_side[$k]['caption']?>" title="<?=$four_side[$k]['caption']?>" width="238" height="155" />
                        <?
                            break;

                        case 'yt':?>
                        <img src="<?=$url.'cache/'.$this->img_map->showImage($four_side[$k]['mFile'].".jpg",238,155,"exacttop");?>" alt="<?=$four_side[$k]['caption']?>" title="<?=$four_side[$k]['caption']?>" width="238" height="155" />
                        <div class="videol">&nbsp;</div><?
                            break;
                    }

                ?>

                <div class="nadnaslov <?=$cssBgImageOverwrite?>"><?
                        //echo strlen($four_side[$k]['uptitle']);
                        if ($four_side[$k]['mType']=='yt'){
                            echo 'Video';
                        }else{
                            if(strlen($four_side[$k]['uptitle'])>43){
                                echo $four_side[$k]['cName'];
                            }else echo $four_side[$k]['uptitle']; 
                        }

                ?></div>
            </a> 

        </div>
        <div style="clear: both;"></div>
        <h3><a class="mLink" href="<?=$link?>"><?=$four_side[$k]['title']?></a></h3>

    </div>

    <?}?>                                 